//
//  StatusForwardCell.swift
//  LVWeibo
//
//  Created by lv on 15/7/2.
//  Copyright © 2015年 lv. All rights reserved.
//

import UIKit
import FFAutoLayout

class StatusForwardCell: StatusCell {
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        forwardLabel = UILabel(textColor: UIColor.darkGrayColor(), fonSize: 14, layoutWidth: UIScreen.mainScreen().bounds.width - 25, mutiLines: true)
        // 添加子控件
        insertSubview(forwardLabel!, belowSubview: picturesView)
        insertSubview(forwardButton, belowSubview: forwardLabel!)

        
        // 自动布局
        forwardLabel!.ff_AlignInner(ff_AlignType.TopLeft, referView: forwardButton, size: nil, offset: CGPoint(x: 12, y: 12))
        // 修改配图视图布局
        let cons = picturesView.ff_AlignVertical(ff_AlignType.BottomLeft, referView: forwardLabel!, size: CGSize(width: 290, height: 90), offset: CGPoint(x: 0, y: 12))
        widthCons = picturesView.ff_Constraint(cons, attribute: NSLayoutAttribute.Width)
        heightCons = picturesView.ff_Constraint(cons, attribute: NSLayoutAttribute.Height)
        // 背景按钮
        forwardButton.backgroundColor = UIColor(white: 0.97, alpha: 1.0)
        forwardButton.ff_AlignVertical(ff_AlignType.BottomLeft, referView: contentLable, size: nil, offset: CGPoint(x: -12, y: 10))
        forwardButton.ff_AlignVertical(ff_AlignType.TopRight, referView: footerView, size: nil, offset: CGPoint(x: 12, y: -10))
    }
    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //MARK:-  懒加载控件
    // 转发微博文字(定义在父控件中)
    // 转发微博背景按钮
    lazy var forwardButton: UIButton = UIButton(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 0))
}
